package edu.xust.controller;

import edu.xust.pojo.DataBean;
import edu.xust.service.HbaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@Controller
public class DataController {
    @Autowired
    HbaseService hbaseService;

    @RequestMapping("/getdata")
    @ResponseBody
    public List<DataBean> getDate() throws IOException {
        List list = new ArrayList();
        List companyData = hbaseService.getCompanyData();
        List freeData = hbaseService.getFreeData();
        List vipData = hbaseService.getVipData();
        list.add(companyData);
        list.add(freeData);
        list.add(vipData);
        return list;
    }
}
